package edu.sctu.zhuyingzhi.month201505.day20150520.listTest;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by user11 on 2015/5/17.
 */
public class TextOne extends TextMore {

    public void getTercherInfo(){

        List<Teacher> list = sotrNumber();

        for (int i = 0; i < list.size(); i++) {
            System.out.println("******"+list.get(i).getName()+"******");
            System.out.println("工号："+list.get(i).getNumber()+"\t职称："+list.get(i).getTitle()+"\t性别："+list.get(i).getSex()+"课程："+list.get(i).getLesson());
            System.out.println("******"+list.get(i).getName()+"******");
            System.out.println("所教学生：");

            for (int j = 0; j < list.get(i).getStudent().size(); j++) {
                System.out.println("\t"+list.get(i).getStudent().get(j).getName());
            }

        }


    }

    public List<Student> getStudent(int code,List<Student> list){
        List<Student> list1 = new ArrayList<>();
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getGradle()>code){
                list1.add(list.get(i));
            }
        }
            return list1;
    }

    public void getCode(){

        List<Teacher> listT = pritCoded();

        List<Student> listS = new ArrayList<>();

        for (int i = 0; i < listT.size(); i++) {
            listS = listT.get(i).getStudent();
        }

        InterMod inter = new InterMod() {
            @Override
            public void method(List<Student> list) {
                List<Student> list1 = getStudent(75,list);
                System.out.println("教授下成绩大于"+75+"的学生：");
                for (int i = 0; i < list1.size(); i++) {


                    System.out.print(list1.get(i).getName() + "\t");
                }

                }
        };
        inter.method(listS);

    }

}
